home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992…ugust: Hack to the Future / ADC Developer CD (1992-08) (''Hack To The Future'')_iso / Dev.CD 199208.iso / Periodicals / develop / develop 9 code / Tracks / TestDrvr ƒ / TestDrvr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-06  |  1.6 KB  |  51 lines  |  [TEXT/MPS ]

  1. #ifndef __SAMPDRVR__
  2. #define __SAMPDRVR__
  3. #include <Types.h>
  4. #include <Quickdraw.h>
  5. #include <Files.h>
  6. #include <Devices.h>
  7. #include "tracksinfo.h"
  8.  
  9.  
  10. #define theKeyMap            ((short *)(0x0174))  // These routines stolen from the JMP libraries
  11. #define TEST_FLAG(f,m)        (((f) & (m)) == (m)) /* f = flag, m = mask; mask should not be zero! */
  12. #define MAKE_EVEN(n)        (((n) + 1) & ~1)
  13.  
  14. #define CAPS_LOCK_DOWN()    (TEST_FLAG(theKeyMap[3],0x0002))
  15. #define OPTION_KEY_DOWN()    (TEST_FLAG(theKeyMap[3],0x0004))
  16. #define CMD_KEY_DOWN()        (TEST_FLAG(theKeyMap[3],0x8000))
  17.  
  18. /* Debugging aids… (if capsLock key is down)
  19. */
  20. #define DEBUG(s)            if (CAPS_LOCK_DOWN()) DebugStr(s)
  21. #define FREEZE()            while (CAPS_LOCK_DOWN())
  22.  
  23.  
  24.  
  25. typedef struct 
  26. {    
  27.  
  28.     /* TestDrvr globals */
  29.     long     EventCount;        // keeps track of how many times the driver has received a accRun csCode.
  30.     
  31.     /* Mandatory Tracks Globals */
  32.     
  33.     ProcPtr    fTraceProcPtr;    /* Points to trace driver's TraceProc routine (or nil) */
  34.     Ptr        fTraceArg;        /* Contains the trace driver's refCon value (points to its globals) */
  35.     
  36. } Globals;
  37.  
  38. OSErr TControl(CntrlParam *ctlPB, DCtlPtr dCtl);
  39. OSErr TOpen(CntrlParam *ctlPB, DCtlPtr dCtl);
  40. OSErr TPrime(CntrlParam *ctlPB, DCtlPtr dCtl);
  41. OSErr TStatus(CntrlParam *ctlPB, DCtlPtr dCtl);
  42.  
  43. pascal short DrvrEntry(Globals *globals, short csCode, Ptr paramPtr, DCtlPtr dCtl);
  44. void HandleOptKeyDown(Globals *globals);
  45. void HandleCmdKeyDown(Globals *globals, DCtlPtr dCtl);
  46.  
  47. enum {kStackPeekEx, kCmdKeyDown, kOptKeyDown, kUnexpectedErr};        /* For DiagID's 0-31 */
  48. // If we wanted to implement Trace Levels 2, 3, and/or 4, we'd define them here...
  49.  
  50. #endif
  51.